﻿using System.Collections.Generic;
using System.IO;

namespace Effector.Data
{
    /// <summary>
    /// Directory information class.
    /// </summary>
    public class DirectoryElement
    {
        private DirectoryInfo _dir;

        /// <summary>
        /// Initializes a new instance of the <see cref="DirectoryElement"/> class.
        /// </summary>
        public DirectoryElement()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DirectoryElement"/> class.
        /// </summary>
        /// <param name="di">The di.</param>
        public DirectoryElement(DirectoryInfo di)
        {
            _dir = di;
        }

        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name
        {
            get { return _dir.Name; }
        }

        /// <summary>
        /// Gets the path.
        /// </summary>
        /// <value>The path.</value>
        public string Path
        {
            get { return _dir.FullName; }
        }

        /// <summary>
        /// Gets the directory.
        /// </summary>
        /// <value>The directory.</value>
        public DirectoryInfo Directory
        {
            get { return _dir; }
        }

        private List<DirectoryElement> _subDirectories = new List<DirectoryElement>();

        /// <summary>
        /// Gets the sub directories.
        /// </summary>
        /// <value>The sub directories.</value>
        public List<DirectoryElement> SubDirectories
        {
            get { return _subDirectories; }
        }
    }
}
